home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp® 2.0.1 Tutorial / Chapter 10 / IconEdit.r next >
Encoding:
Text File  |  1990-10-25  |  4.6 KB  |  167 lines  |  [TEXT/MPS ]

  1. /*********************************************************************************/
  2. /* IconEdit.r                                                                     */
  3. /*                                                                                 */
  4. /* Copyright © 1989 Apple Computer, Inc.  All rights reserved.                       */
  5. /*                                                                                  */
  6. /*********************************************************************************/
  7.  
  8. /* ==============================   Includes   ================================= */
  9.  
  10. #ifndef _TYPES.R_
  11. #include "Types.r"
  12. #endif
  13.  
  14. #ifndef _MacAppTypes_
  15. #include "MacAppTypes.r"
  16. #endif
  17.  
  18. #ifndef __ViewTypes__
  19. #include "ViewTypes.r"
  20. #endif
  21.  
  22. #if qDebug
  23. include "Debug.rsrc";
  24. #endif
  25. include "MacApp.rsrc";
  26.  
  27. include "IconEdit" 'CODE';
  28.  
  29.  
  30. /* ==============================   Constants   ================================ */
  31.  
  32. #define kSeedIconId            1000
  33.  
  34. #define kIconWindowId        1000
  35.  
  36. #define kIconWindowId        1000
  37. #define kIconViewId            1001
  38.  
  39. #define kIconViewHeight        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  40. #define kIconViewWidth        32 * 7 + 10     /* 7 times actual size, 5 pixel borders */
  41.  
  42. #define kIconWindowHeight    kIconViewHeight
  43. #define kIconWindowWidth    kIconViewWidth
  44.  
  45.  
  46.  
  47. /* ==============================   Seed Icon   ================================ */
  48.  
  49. resource 'ICON' (kSeedIconId, purgeable) {
  50.     $"0001 0000 0002 8000 0004 4000 0008 2000 0010 1000 0020 0800 0040 0400 0080 0200"
  51.     $"0100 0100 0200 0080 0400 0040 0800 0020 1000 0010 2000 0008 4000 3F04 8000 4082"
  52.     $"4000 8041 2001 3022 1001 C814 080E 7F8F 0402 3007 0201 0007 0100 8007 0080 6007"
  53.     $"0040 1FE7 0020 021F 0010 0407 0008 0800 0004 1000 0002 2000 0001 4000 0000 8000"
  54. };
  55.  
  56.  
  57.  
  58.  
  59. /* =============================   Icon Window   =============================== */
  60.  
  61. resource 'view' (kIconWindowId, purgeable) {
  62.     {
  63.         root, 'WIND', { 50, 20 }, { kIconWindowHeight, kIconWindowWidth },
  64.         sizeVariable, sizeVariable, shown, enabled,
  65.         Window        { "", zoomDocProc, goAwayBox, resizable, modeless,
  66.                     ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
  67.                     openWithDocument, dontAdaptToScreen, stagger, forceOnScreen,
  68.                     dontCenter, noid, "" };
  69.                     
  70.         'WIND', IncludeViews    { kIconViewId }
  71.     }
  72. };
  73.  
  74. resource 'view' (kIconViewId, purgeable) {
  75.     {
  76.         root, 'ICON', { 0, 0 }, { kIconViewHeight, kIconViewWidth },
  77.         sizeVariable, sizeVariable, shown, enabled,
  78.         View        { "TIconView"}
  79.     }
  80. };
  81.  
  82.  
  83. /* NOTE: if you used ViewEdit, then replace the above 'view' resources with:     */
  84. /* include "Views.rsrc" 'view';                                                  */
  85.  
  86.  
  87.  
  88.  
  89. /* ================================   Menus   ================================== */
  90.  
  91. resource 'cmnu' (mApple) {
  92.     1,
  93.     textMenuProc,
  94.     0x7FFFFFFD,
  95.     enabled,
  96.     apple,
  97.      {
  98.     /* [1] */    "About IconEdit…",    noIcon,    noKey,    noMark,    plain,    cAboutApp;
  99.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand
  100.     }
  101. };
  102.  
  103.  
  104. /* ------------------------------------------------------------------------------ */
  105.  
  106. resource 'cmnu' (mFile) {
  107.     2,
  108.     textMenuProc,
  109.     allEnabled,
  110.     enabled,
  111.     "File",
  112.      {
  113.     /* [1] */    "New",                noIcon,    "N",    noMark,    plain,    cNew;
  114.     /* [2] */    "Open…",            noIcon,    "O",    noMark,    plain,    cOpen;
  115.     /* [3] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  116.     /* [4] */    "Close",            noIcon,    noKey,    noMark,    plain,    cClose;
  117.     /* [5] */    "Save",                noIcon,    noKey,    noMark,    plain,    cSave;
  118.     /* [6] */    "Save As…",            noIcon,    noKey,    noMark,    plain,    cSaveAs;
  119.     /* [7] */    "Revert to Saved",    noIcon,    noKey,    noMark,    plain,    cRevert;
  120.     /* [8] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  121.     /* [9] */    "Page Setup…",        noIcon,    noKey,    noMark,    plain,    cPageSetup;
  122.     /* [10] */    "Print…",            noIcon,    noKey,    noMark,    plain,    cPrint;
  123.     /* [11] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  124.     /* [12] */    "Quit",                noIcon,    "Q",    noMark,    plain,    cQuit
  125.     }
  126. };
  127.  
  128.  
  129. /* ------------------------------------------------------------------------------ */
  130.  
  131. resource 'cmnu' (mEdit) {
  132.     3,
  133.     textMenuProc,
  134.     allEnabled,
  135.     enabled,
  136.     "Edit",
  137.      {
  138.     /* [1] */    "Undo",                noIcon,    "Z",    noMark,    plain,    cUndo;
  139.     /* [2] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  140.     /* [3] */    "Cut",                noIcon,    "X",    noMark,    plain,    cCut;
  141.     /* [4] */    "Copy",                noIcon,    "C",    noMark,    plain,    cCopy;
  142.     /* [5] */    "Paste",            noIcon,    "V",    noMark,    plain,    cPaste;
  143.     /* [6] */    "Clear",            noIcon,    noKey,    noMark,    plain,    cClear;
  144.     /* [7] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  145.     /* [8] */    "Show Clipboard",    noIcon,    noKey,    noMark,    plain,    cShowClipboard
  146.     }
  147. };
  148.  
  149.  
  150. /* ------------------------------------------------------------------------------ */
  151.  
  152. resource 'cmnu' (mBuzzWords) {
  153.     mBuzzWords,
  154.     textMenuProc,
  155.     allEnabled,
  156.     enabled,
  157.     "Buzzwords",
  158.      {
  159.     /* [1] */    "Page Setup Change", noIcon, noKey, noMark, plain, cChangePrinterStyle
  160.     }
  161. };
  162.  
  163.  
  164. /* ------------------------------------------------------------------------------ */
  165.  
  166. resource 'MBAR' (kMBarDisplayed) { {mApple; mFile; mEdit} };
  167.